package com.dc.di.ftpserver.ftplet;

import org.apache.ftpserver.impl.FtpIoSession;

import com.dc.di.ftpserver.util.Const;

public class TransferHandlerFactory {
	public static TransferHandler createTransferHandler(FtpIoSession session)throws Exception{
		 if(session.getFileSystemView().getWorkingDirectory().getAbsolutePath().startsWith(Const.ATTACH_PATH)){
			 return AttachmentTransferHandler.getInstance();
         }else if(session.getFileSystemView().getWorkingDirectory().getAbsolutePath().equals(Const.MESSAGE_PATH)){
        	 return SoapTransferHandler.getInstance();
         }	  
		 return DefaultTransferHandler.getInstance();
	}
}
